// hema-toast/index.js
import Vue from 'vue';
import hemaToast from './index.vue';

const Toast = Vue.extend(hemaToast);

let instance;
const toast = (options = {}) => {
  instance = new Toast({
    data: options,
  });
  instance.vm = instance.$mount();
  document.body.appendChild(instance.vm.$el);
  return instance.vm;
};

export default toast;
